Напишите функцию sum_range(start, end), которая суммирует все целые числа от значения «start» до величины «end» включительно. Если пользователь задаст первое число большее чем второе, просто поменяйте их местами.
При решении удобно воспользоваться встроенными функциями range() и sum().
Решение:
def sum_range(start, end): if start > end: end, start = start, end return sum(range(start, end + 1))
# Тесты print(sum_range(2, 12)) print(sum_range(-4, 4)) print(sum_range(3, 2)) Результат выполнения: 77 0 5 Свой вариант решения в комментарии 💬
Напишите функцию sum_range(start, end), которая суммирует все целые числа от значения «start» до величины «end» включительно. Если пользователь задаст первое число большее чем второе, просто поменяйте их местами.
При решении удобно воспользоваться встроенными функциями range() и sum().
Решение:
def sum_range(start, end): if start > end: end, start = start, end return sum(range(start, end + 1))
# Тесты print(sum_range(2, 12)) print(sum_range(-4, 4)) print(sum_range(3, 2)) Результат выполнения: 77 0 5 Свой вариант решения в комментарии 💬
#задачи
BY Python Turbo. Уютное сообщество Python разработчиков.
In many cases, the content resembled that of the marketplaces found on the dark web, a group of hidden websites that are popular among hackers and accessed using specific anonymising software.“We have recently been witnessing a 100 per cent-plus rise in Telegram usage by cybercriminals,” said Tal Samra, cyber threat analyst at Cyberint.The rise in nefarious activity comes as users flocked to the encrypted chat app earlier this year after changes to the privacy policy of Facebook-owned rival WhatsApp prompted many to seek out alternatives.
Look for Channels Online
You guessed it – the internet is your friend. A good place to start looking for Telegram channels is Reddit. This is one of the biggest sites on the internet, with millions of communities, including those from Telegram.Then, you can search one of the many dedicated websites for Telegram channel searching. One of them is telegram-group.com. This website has many categories and a really simple user interface. Another great site is telegram channels.me. It has even more channels than the previous one, and an even better user experience.These are just some of the many available websites. You can look them up online if you’re not satisfied with these two. All of these sites list only public channels. If you want to join a private channel, you’ll have to ask one of its members to invite you.
Python Turbo Уютное сообщество Python разработчиков from ar